package com.example.skindemo.ui.settings;


import android.view.View;
import android.widget.ImageView;


import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.example.skindemo.R;
import com.example.skindemo.ui.bean.SkinThemeBean;

import java.util.List;

/**
 * @author: tjf
 * @date: 2022-11-08
 * @desc：
 */
public class skinThemeAdapter extends BaseQuickAdapter<SkinThemeBean, BaseViewHolder> {
    public skinThemeAdapter(List<SkinThemeBean> data) {
        super(R.layout.skin_theme_item, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, SkinThemeBean skinThemeBean) {
        helper.getView(R.id.skin_item_theme_check_img)
                .setVisibility(skinThemeBean.isCheckTheme() ? View.VISIBLE : View.GONE);
        helper.setText(R.id.skin_item_theme_color_text_tv, skinThemeBean.getThemeName());
        ImageView themeimg = helper.getView(R.id.skin_item_theme_color_img);
        themeimg.setBackgroundResource(skinThemeBean.getThemeType());
    }
}
